package com.tc.juc.n1;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;

/**
 * @Auther: tianchao
 * @Date: 2021/9/27 19:32
 * @Description:
 */
@Slf4j
public class TestPark {


    public static void main(String[] args) throws InterruptedException {
        test01();
    }


    public static void test01() throws InterruptedException {
        Thread t1 = new Thread(()->{
            log.info("park....");
            LockSupport.park();
            log.info("unpack...");
            log.info("打断状态:{}",Thread.currentThread().isInterrupted());
        },"test");
        Thread.State state = t1.getState();
        System.out.println(state);
        t1.start();
        Thread.sleep(1000);
        t1.interrupt();
    }
}
